bitkeeper revision 1.1236.1.200 (424efe01yAPteHQ-fOPSaM_1yE9IfA)
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Sat, 2 Apr 2005 20:18:09 +0000 (20:18 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Sat, 2 Apr 2005 20:18:09 +0000 (20:18 +0000)
Makefile fixes. mbootpack dependencies now work properly.
Signed-off-by: Keir Fraser <keir@xensource.com>
Config.mk
tools/misc/mbootpack/Makefile
xen/Rules.mk

index b79ede395253b5a350fdd78394d5ea95a13b2eec..2db6c644fe504c64223467182463276b9afee5c7 100644 (file)
--- a/Config.mk
+++ b/Config.mk
@@ -10,9 +10,7 @@ override TARGET_SUBARCH  := $(XEN_TARGET_ARCH)
 override COMPILE_ARCH    := $(patsubst x86%,x86,$(XEN_COMPILE_ARCH))
 override TARGET_ARCH     := $(patsubst x86%,x86,$(XEN_TARGET_ARCH))
 
-#
-# Tool configuration Makefile fragment
-#
+# Tools to run on system hosting the build
 HOSTCC     = gcc
 HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer 
 
@@ -26,7 +24,6 @@ STRIP      = $(CROSS_COMPILE)strip
 OBJCOPY    = $(CROSS_COMPILE)objcopy
 OBJDUMP    = $(CROSS_COMPILE)objdump
 
-
 ifneq ($(EXTRA_PREFIX),)
 EXTRA_INCLUDES += $(EXTRA_PREFIX)/include
 EXTRA_LIB += $(EXTRA_PREFIX)/lib
@@ -34,7 +31,3 @@ endif
 
 LDFLAGS += $(foreach i, $(EXTRA_LIB), -L$(i)) 
 CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i))
-
-CFLAGS += -g
-
-
index 7cd6a6ad14c47e67275b98aefa15ae9003560921..69d26dc014c385e8ad05512fa6b6694fddd60741 100644 (file)
@@ -8,56 +8,36 @@ INSTALL_DIR   = $(INSTALL) -d -m0755
 XEN_ROOT=../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS   += -Wall -Werror -O3 
-
-INCLUDES += -I $(XEN_XC)
-INCLUDES += -I $(XEN_LIBXC)
-CFLAGS   += $(INCLUDES)
-
-HDRS     = $(wildcard *.h)
-
-TARGETS  = mbootpack
-
-INSTALL_BIN  = mbootpack
-INSTALL_SBIN =
-
 all: build
-build: $(TARGETS)
+build: mbootpack
 
 install: build
-       $(INSTALL_PROG) $(INSTALL_BIN) $(DESTDIR)/usr/bin
+       $(INSTALL_PROG) mbootpack $(DESTDIR)/usr/bin
 
-#
-#  What object files need building for the program
-#
-
-OBJS   := mbootpack.o buildimage.o
-DEPS   := mbootpack.d buildimage.d
-
-# 
 #  Tools etc.
-#
-
 RM     := rm -f
 GDB    := gdb
 INCS   := -I. -I-
 DEFS   := 
 LDFLAGS        := 
 CC     := gcc
-CFLAGS         := -W -Wall -Wpointer-arith -Wcast-qual -Wno-unused -Wno-format
+CFLAGS         := -Wall -Wpointer-arith -Wcast-qual -Wno-unused -Wno-format
 CFLAGS += -Wmissing-prototypes
 #CFLAGS        += -pipe -g -O0 -Wcast-align
 CFLAGS += -pipe -O3 
 
-#
-#  Rules
-#
+#  What object files need building for the program
+OBJS   := mbootpack.o buildimage.o
+
+# Get gcc to generate the dependencies for us.
+DEPFLAGS = -Wp,-MD,.$(@F).d
+DEPS     = .*.d
 
 mbootpack: $(OBJS)
        $(CC) -o $@ $(filter-out %.a, $^) $(LDFLAGS)
 
-clean: FRC
-       $(RM) mbootpack *.o *.d bootsect setup bzimage_header.c bin2c
+clean:
+       $(RM) mbootpack *.o $(DEPS) bootsect setup bzimage_header.c bin2c
 
 bootsect: bootsect.S
        $(CC) $(CFLAGS) $(INCS) $(DEFS) -D__MB_ASM -c bootsect.S -o bootsect.o
@@ -78,16 +58,12 @@ buildimage.c: bzimage_header.c
        @
 
 %.o: %.S
-       $(CC) $(CFLAGS) $(INCS) $(DEFS) -c $< -o $@
+       $(CC) $(DEPFLAGS) $(CFLAGS) $(INCS) $(DEFS) -c $< -o $@
 
 %.o: %.c
-       $(CC) $(CFLAGS) $(INCS) $(DEFS) -c $< -o $@
-
-%.d: %.c
-       $(CC) $(CFLAGS) $(INCS) $(DEFS) -M $< > $@
+       $(CC) $(DEPFLAGS) $(CFLAGS) $(INCS) $(DEFS) -c $< -o $@
 
-FRC: 
-.PHONY:: all FRC clean gdb
+.PHONY: all clean gdb
 .PRECIOUS: $(OBJS) $(OBJS:.o=.c) $(DEPS)
 .SUFFIXES: 
 
index f9650fc74459151dbfd7060532cfc083f4dfcb1f..cf30a12ef75eb3e5243a9adc72500e9dd2401620 100644 (file)
@@ -9,12 +9,6 @@ crash_debug ?= n
 
 include $(BASEDIR)/../Config.mk
 
-# Set ARCH/SUBARCH appropriately.
-override COMPILE_SUBARCH := $(XEN_COMPILE_ARCH)
-override TARGET_SUBARCH  := $(XEN_TARGET_ARCH)
-override COMPILE_ARCH    := $(patsubst x86%,x86,$(XEN_COMPILE_ARCH))
-override TARGET_ARCH     := $(patsubst x86%,x86,$(XEN_TARGET_ARCH))
-
 TARGET  := $(BASEDIR)/xen
 HDRS    := $(wildcard $(BASEDIR)/include/xen/*.h)
 HDRS    += $(wildcard $(BASEDIR)/include/public/*.h)